<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<script type="text/javascript" src="__ROOT__/js/jquery.SuperSlide.js"></script>
<div id="riskTest1" class="reveal-modal">
    <div class="Big_Slide_Head">
        风险投资测试 
        <a class="close-reveal-modal close_layer">×</a>
    </div>
    <div class="slideTxtBox">
        <div>
            <ul class="hd">
                <li><a class="on">1</a></li>
                <li><a>2</a></li>
                <li><a>3</a></li>
                <li><a>4</a></li>
                <li><a>5</a></li>
                <li><a>6</a></li>
                <li><a>7</a></li>
                <li><a>8</a></li>
            </ul>
            <div class="Big_Slide_Line"></div>
            <div class="clear"></div>
        </div>
        <ul class="bd">
            
            <?php foreach($ques as $k => $v):?>
                <li id="Big_Slide_<?php $qnum=$k+1; echo $qnum;?>">
                    <h1><?php $proportion=$v['proportion'];echo $v['title']?></h1>
                      <?php foreach($v['option'] as $k => $v):?>
                         <p><input name="q<?php echo $qnum;?>" type="radio" value="<?php echo $v["score"]*$proportion;?>"><span><?php echo $v['option'];?></span></p>
                     <?php endforeach?>
                    <div class="clear"></div>
                </li>   
            <?php endforeach?>

        
        </ul>
        <div class="Big_Slide_Contrl align-right">
            <a href="javascript:void(0)" class="prev btn btn-success">上一题</a>
            <a href="javascript:void(0)" class="next btn btn-danger">下一题</a>
            <a id="testSubmit" href="javascript:void(0)" class="submit btn btn-danger" style="display:none;">提 交</a>
        </div>
    </div>
    <script type="text/javascript">jQuery(".slideTxtBox").slide({effect:"left"});</script>

<script type="text/javascript">

$(function() {
        $('#testSubmit').click(function(){
            
        
        $.ajax({  
            type: "post",  
            url: "__APP__/Pc/Test/getscore",  
            dataType: 'json',
            data: {q1:$("input[name='q1']:checked").val(),q2:$("input[name='q2']:checked").val(),q3:$("input[name='q3']:checked").val(),q4:$("input[name='q4']:checked").val(),q5:$("input[name='q5']:checked").val(),q6:$("input[name='q6']:checked").val(),q7:$("input[name='q7']:checked").val(),q8:$("input[name='q8']:checked").val()},
            beforeSend: function(XMLHttpRequest){   
            },  
            error:function(){
                alert('error');
            },
            success: function(json){
                //alert('success!');
                if(json.status == 1){
                    //alert(json.data['score']);
                    //alert(json.data['type']);
                    //window.location.href='testscore?code='+ json.info;
                    window.location.href='__APP__/Pc/Test/testResult/'+json.data['type'] +'/' +json.data['score'] +'/'+json.data['oldscore'];
                } else
                {
                    alert('wrong!');
                }
            } 
        })
    })
})      

</script>
</div>